v[7];c(int*a,int*b){return*a-*b;}main(i,u,n,l,h,a,b){for(gets(v);~scanf("%d",&n);qsort(v,7,4,c),printf(*v==v[1]||v[6]==v[5]?"Nagari\n":"%d/%d\n",a,b)){for(memset(v,0,28);n--&&scanf("%d",&u);)for(i=0;i<7;v[i]+=!!(u&(2<<i++)));for(l=100,h=i=0;i<7;i++){if(h<v[i])h=v[i],a=i+1;if(l>v[i])l=v[i],b=i+1;}}}
